/******************************************************************************* 
 * Copyright (C) 2012-2015 Microfountain Technology, Inc. All Rights Reserved. 
 * 
 * Unauthorized copying of this file, via any medium is strictly prohibited.   
 * Proprietary and confidential
 * 
 * Last Modified: 2015-9-17 11:54:50
 ******************************************************************************/
package cn.com.xy.sms.sdk.service.pubInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.json.JSONArray;
import org.json.JSONObject;

import android.content.Context;
import android.os.Process;
import cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfigInterface;
import cn.com.xy.sms.sdk.Iservice.XyCallBack;
import cn.com.xy.sms.sdk.constant.Constant;
import cn.com.xy.sms.sdk.db.MenuInfoManager;
import cn.com.xy.sms.sdk.db.ParseItemManager;
import cn.com.xy.sms.sdk.db.entity.MenuInfo;
import cn.com.xy.sms.sdk.db.entity.NetQueryTimeManager;
import cn.com.xy.sms.sdk.db.entity.SysParamEntityManager;
import cn.com.xy.sms.sdk.db.entity.TaskInfo;
import cn.com.xy.sms.sdk.db.entity.UpdateTaskManager;
import cn.com.xy.sms.sdk.db.entity.pubinfo.PubInfoManager;
import cn.com.xy.sms.sdk.dex.DexUtil;
import cn.com.xy.sms.sdk.iccid.IccidLocationUtil;
import cn.com.xy.sms.sdk.log.LogManager;
import cn.com.xy.sms.sdk.net.NetUtil;
import cn.com.xy.sms.sdk.util.JsonUtil;
import cn.com.xy.sms.sdk.util.StringUtils;
import cn.com.xy.sms.sdk.util.XyUtil;
import cn.com.xy.sms.util.ParseManager;
import cn.com.xy.sms.util.SdkCallBack;
/* SDK-616 hewengao 20160918 start */
import cn.com.xy.sms.sdk.threadpool.SmartSmsThreadPoolManager;
/* SDK-616 hewengao 20160918 end */
/**
 * 公众号资料业务类处理
 * 
 * @author Administrator
 * 
 */
public class PubInfoService {
     /* SDK-397 hewengao 20160527 start */
    public final static BackGroundRunnable mPubBackRunnable1 = new BackGroundRunnable(BackGroundRunnable.TYPE_UPDATE_TASK_1);
    public final static BackGroundRunnable mPubBackRunnable2 = new BackGroundRunnable(BackGroundRunnable.TYPE_UPDATE_TASK_2);
    /* SDK-397 hewengao 20160527 end */
    /**
     * 描述：after query this method will check and update MenuInfo ,or download
     * and unzip nqsql.zip ; save the loadTime and updateTime in table named
     * tb_public_num_info ;
     * 
     * 
     * @param ctx
     * @param phoneNum
     * @param numType
     * @param simIccid
     * @param extend
     *            key: SUPPORT_NET_QUERY 含此key 表示支持后台服务器查询。
     * @param callBack
     * @return
     * @return String
     */
    public static String queryPublicInfo(Context ctx, final String phoneNum, final int numType, String simIccid, Map<String, String> extend, final XyCallBack callBack) {
        if (StringUtils.isNull(phoneNum)) {
            return "";
        }
        /* SDK-568 huangzhiqiang 20160728 start */
        if (!isInitSDKComplete(callBack)) {
            return "-1";
        }
        /* SDK-568 huangzhiqiang 20160728 end */
        try {
            final String cnum = StringUtils.getValueByKey(extend, "cnum");
            String areaCode = "";
            areaCode = StringUtils.getValueByKey(extend, "code");
            int simIndex = PubInfoManager.parseSimIndex(StringUtils.getValueByKey(extend, "simIndex"));
            if (StringUtils.isNull(areaCode)) { // 通过iccid、短信中心号码、simIndex查询归属地。
                /* SDK-485 huangzhiqiang 20160622 start */
                areaCode = IccidLocationUtil.getAreaCodeByCnumOrIccid(cnum, simIndex, simIccid, phoneNum);
                /* SDK-485 huangzhiqiang 20160622 end */
            }
            JSONObject pubInfo = PubInfoManager.queryPubInfoByNum(phoneNum, areaCode, numType);
            String res = ""; 
            /* SDK-510 songzhirong 20160628 start */   
            if (extend != null && extend.containsKey("QUERY_NOW")) {
                querySinglePubInfoFromNetServer(phoneNum, cnum, numType, areaCode, simIccid, callBack, true, true);
            } else {
                  /* SDK-397 huangzhiqiang 20160526 start */   
                 boolean needUpdateNow = PubInfoManager.needUpdatePubInfo(pubInfo);
                 if (pubInfo != null && !needUpdateNow) {
                     if (PubInfoManager.checkIsEffectivePubInfoIfNameTypeIsSign(pubInfo)) {
                         res = JsonUtil.pubInfoToJson(pubInfo);
                     }
                 } else if (extend != null && extend.containsKey("SUPPORT_NET_QUERY")) {
                     querySinglePubInfoFromNetServer(phoneNum, cnum, numType, areaCode, simIccid, callBack, true, needUpdateNow);
                 } else if (extend != null && extend.containsKey("SYNC_QUERY")) {
                     /*IMOO-21 likuangkuang 20170104 start */
                     querySinglePubInfoFromNetServer(phoneNum, cnum, numType, areaCode, simIccid, callBack, true, needUpdateNow, false);
                     /*IMOO-21 likuangkuang 20170104 end */
                 } else {
                     querySinglePubInfoFromNetServer(phoneNum, cnum, numType, areaCode, simIccid, callBack, false, needUpdateNow);
                 }
                 /* SDK-397 huangzhiqiang 20160526 end */
                 XyUtil.doXycallBackResult(callBack, res);
            }
            /* SDK-510 songzhirong 20160628 end */   

            // 后台批量检测更新
            checkUpdatePubInfoBackGround(areaCode, simIccid);
            return res;
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "PubInfoService queryPublicInfo error", e);
            XyUtil.doXycallBackResult(callBack, "");
        }

        return "";
    }

    /**
     * 描述：after query ,this method will check and update MenuInfo ,or download
     * and unzip nqsql.zipv
     * 
     * @param ctx
     * @param phoneNum
     * @param numType
     * @param simIccid
     * @param extend
     * @param callBack
     * @return
     * @return String
     */
    public static String queryPublicInfoWithId(Context ctx, String phoneNum, int numType, String simIccid, Map<String, String> extend, XyCallBack callBack) {
        if (StringUtils.isNull(phoneNum)){
            return "";
        }
        /* SDK-568 huangzhiqiang 20160728 start */
        if (!isInitSDKComplete(callBack)) {
            return "-1";
        }
        /* SDK-568 huangzhiqiang 20160728 end */
        try {
            String cnum = StringUtils.getValueByKey(extend, "cnum");
            String areaCode = "";
            areaCode = StringUtils.getValueByKey(extend, "code");
            int simIndex = PubInfoManager.parseSimIndex(StringUtils.getValueByKey(extend, "simIndex"));
            String id = StringUtils.getValueByKey(extend, "id");
            if (StringUtils.isNull(areaCode)) { // 通过iccid、短信中心号码、simIndex查询归属地。
                /* SDK-485 huangzhiqiang 20160622 start */
                areaCode = IccidLocationUtil.getAreaCodeByCnumOrIccid(cnum, simIndex, simIccid, phoneNum);
                /* SDK-485 huangzhiqiang 20160622 end */
            }
    
            // 是否支持在线查询（0不支持，1支持（默认））
            int type = SysParamEntityManager.getIntParam(Constant.getContext(), Constant.QUERY_ONLINE);
    
            JSONObject pubInfo = PubInfoManager.queryPubInfoByNum(phoneNum, areaCode, numType);
            String res = "";
            /* SDK-397 huangzhiqiang 20160524 start */
            boolean needUpdateNow = PubInfoManager.needUpdatePubInfo(pubInfo);
            if (pubInfo == null || needUpdateNow ) {
                /* SDK-397 huangzhiqiang 20160524 end */
                /* SDK-397 hewengao 20160527 start */
                // 网络请求// 支持在线查询
                if (type == 1 && NetUtil.isEnhance()) {
                    /* SDK-397 huangzhiqiang 20160524 start */
                    PubInfoNetService.queryPubInfoRequestWithId(phoneNum, cnum, areaCode, simIccid, numType + "", callBack, 0, id, needUpdateNow);
                    /* SDK-397 huangzhiqiang 20160524 end */
                }   
               /* SDK-397 hewengao 20160527 end */
            } else{// 本地有就直接返回。
                /* SDK-397 huangzhiqiang 20160526 start */
                if (PubInfoManager.checkIsEffectivePubInfoIfNameTypeIsSign(pubInfo)) {
                    // 本地有就直接返回。
                    res = JsonUtil.pubInfoToJson(pubInfo);
                    XyUtil.doXycallBackResult(callBack, 0, res, id);
                }
                /* SDK-397 huangzhiqiang 20160526 end */
            }
            /* SDK-397 hewengao 20160527 start */
            checkUpdatePubInfoBackGround(areaCode,simIccid);
            /* SDK-397 hewengao 20160527 end */
            return res;
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "PubInfoService queryPublicInfoWithId error", e);
            XyUtil.doXycallBackResult(callBack, "");
        }
        return "";
    }

    /* SDK-568 huangzhiqiang 20160728 start */
    private static boolean isInitSDKComplete(XyCallBack callBack) {
        if(ParseManager.isInitData()){
            return true;
        }
        XyUtil.doXycallBackResult(callBack, "-1");
        return false;
    }
    /* SDK-568 huangzhiqiang 20160728 end */

    /**
     * 检查更新
     */
    /* SDK-397 hewengao 20160527 start */
    public static void checkQueryMenuSql() {
        /*ONEPLUS-1607 songzhirong 20161022 start*/
        if (System.currentTimeMillis() >= (Constant.lastSqlUpdateTime + Constant.sqlUpdateTimeCyc)) {
            /* SDK-397 hewengao 20160527 end*/
                 if (!NetUtil.checkAccessNetWork(2)) {
                     return;
                 }
                 // **************下面就的检查更新方法，下载个包解压覆盖原来的,为了兼容旧版本，不做删除******************************
                 MenuInfo menuInfo = MenuInfoManager.queryMenuInfo("menuMain");
                 // if (menuInfo == null || System.currentTimeMillis() >
                 // (menuInfo.updateTime + DexUtil
                 // .getUpdateCycleByType(OnlineUpdateCycleConfigInterface.TYPE_FIND_MENU_LIST_CYCLE,
                 // Constant.weekTime))) {
                 if (menuInfo == null) {
                     MenuInfoManager.insertOrUpdateMenuInfo("menuMain");// 新增一条记录
                 }
                 // }
                 MenuInfoManager.findMenuList();// 检测更新
                 
                 Constant.lastSqlUpdateTime = System.currentTimeMillis();
                
        }    
        /*ONEPLUS-1607 songzhirong 20161022 end*/
    }

    /**
     * 描述：检查是否需要更新
     * 
     * @param cnum
     * @param areaCode
     * @param iccid
     * @param type
     * @return void
     */
    /**
     * @param areaCode
     * @param iccid
     */
    public static void checkPubInfoUpdate(final String areaCode, final String iccid) {
        try {
            /* SDK-496 zhaojiangwei 20160622 start */
//            PubInfoManager.deleteRuleNumData();
            /* SDK-496 zhaojiangwei 20160622 end */
            exeUpdatePubInfo(areaCode, iccid);
        } catch (Throwable e) {
//            e.printStackTrace();
            LogManager.e(Constant.TAG, "checkPubInfoUpdate: ", e);

        }
    }

     static boolean isExeUpdatePubInfo = false;

    /* SDK-397 hewengao 20160527 start */
     static void checkQueryUnknowNum(final String areaCode, final String iccid, boolean isNewThread) {
    /* SDK-397 hewengao 20160527 end */
        // 未知号码最新网络查询时间 < 当前时间，减 周期时间
        long time = System.currentTimeMillis() - DexUtil.getUpdateCycleByType(OnlineUpdateCycleConfigInterface.TYPE_BATCH_PUBLIC_NUM_INFO_UPDATE_CYCLE, Constant.month);
        /* SDK-500 huangzhiqiang 20160621 start */
        List<String> numArrList = NetQueryTimeManager.getUnKnowNum(areaCode, time);
        /* SDK-500 huangzhiqiang 20160621 end */
        if (numArrList == null || numArrList.isEmpty()) {
            return;
        }
        // 设置未知号码，最新更新时间。
        NetQueryTimeManager.setUpdateUnKnowNumTime(time);
        int len = 0;
        while ((len = numArrList.size()) > 0) {
            List<String> tempArrList = new ArrayList<String>();
            // 最多10个一批
            tempArrList.addAll(numArrList.subList(0, len > 10 ? 10 : len));
            PubInfoNetService.queryPubInfoByList(tempArrList, areaCode, iccid, "1", null, isNewThread);
            numArrList.removeAll(tempArrList);
        }
    }
     /* SDK-397 hewengao 20160527 start */
     static void checkQueryPubInfoNum(final String areaCode, final String iccid, final boolean isNewThead) {
     /* SDK-397 hewengao 20160527 end */
         LogManager.d("duoqu_test", "批量更新开始执行");
        // 拿到本月需要更新的号码
        final List<String> needUpdateList = PubInfoManager.getNumsAppearInMonth();
//        LogManager.d("duoqu_test", "批量更新 needUpdateList="+needUpdateList);

        // 如果本月更新的号码==0，移动更新时间到当前
        if (needUpdateList == null || needUpdateList.size() == 0) {
            LogManager.d("duoqu_test", "批量更新执行完成");
            /* SDK-397 hewengao 20160527 start */
            synchronized (mPubBackRunnable1) {
            /* SDK-397 hewengao 20160527 end */
                isExeUpdatePubInfo = false;
            }
            return;
        } else {
            final XyCallBack callBack = new XyCallBack() {
                @Override
                public void execute(Object... obj) {
                    try {
                        if (obj == null || obj.length < 1 || "-1".equals(obj[0].toString())) {
                            /* SDK-397 hewengao 20160527 start */
                            synchronized (mPubBackRunnable1) {
                            /* SDK-397 hewengao 20160527 end */
                                isExeUpdatePubInfo = false;
                            }
                            return;
                        }
//                        PubInfoManager.updatePubInfoNum_LastLoadTime(areaCode,needUpdateList);
                        checkQueryPubInfoNum(areaCode, iccid, isNewThead);

                    } catch (Throwable e) {
                        LogManager.e(Constant.TAG, "checkQueryPubInfoNum: ", e);

                    }
                }
            };
//            LogManager.d("duoqu_test", "批量更新开始执行 needUpdateList： " + needUpdateList.size());
            PubInfoNetService.queryPubInfoByList(needUpdateList, areaCode, iccid, "1", callBack, isNewThead);
        }
    }

    public static void exeUpdatePubInfo(final String areaCode, final String iccid) {
         /* SDK-397 hewengao 20160527 start */
        synchronized (mPubBackRunnable1) {
            if (isExeUpdatePubInfo) {
                return;
            }
            isExeUpdatePubInfo = true;
            mPubBackRunnable1.areaCode=areaCode;
            mPubBackRunnable1.iccid=iccid;
        }
        /*SDK-616 hewengao 20160912 start*/
        SmartSmsThreadPoolManager.mUploadPubInfoPool.execute(mPubBackRunnable1);
        /*SDK-616 hewengao 20160912 end*/
        /* SDK-397 hewengao 20160527 end */
    }

    public static void exeUpdatePubInfoByIds(final String areaCode, final String iccid, String[] idsArr) {
        if (idsArr == null)
            return;
        int idCount = idsArr.length;
        if (idCount == 0) {
            return;
        }
//        LogManager.d("duoqu_test", "本次更新pid的个数是：" + idCount);
        StringBuffer sb = new StringBuffer();
        int flag = 0;
        for (int i = 0; i < idCount; i++) {
            sb.append(idsArr[i]);
            flag++;
            if (flag == 10) {
                TaskInfo info = new TaskInfo();
                info.content = sb.toString();
                /* SDK-397 huangzhiqiang 20160524 start */
                info.group = UpdateTaskManager.TaskGroup.UPDATE_PUBINFO.toString();
                /* SDK-397 huangzhiqiang 20160524 end */
                UpdateTaskManager.addTask(info);
                sb.setLength(0);
                flag = 0;
            } else {
                sb.append(",");
            }
        }
        if (flag > 0) {
            TaskInfo info = new TaskInfo();
            sb.deleteCharAt(sb.length() - 1);
            info.content = sb.toString();
            /* SDK-397 huangzhiqiang 20160524 start */
            info.group = UpdateTaskManager.TaskGroup.UPDATE_PUBINFO.toString();
            /* SDK-397 huangzhiqiang 20160524 end */
            UpdateTaskManager.addTask(info);
        }
        /* SDK-397 huangzhiqiang 20160524 start */
        UpdateTaskManager.doTask(UpdateTaskManager.TaskGroup.UPDATE_PUBINFO);
        /* SDK-397 huangzhiqiang 20160524 end */
    }

    /**
     * 描述：检查更新并回调
     * 
     * @param extend
     * @param xyCallBack
     * @return void
     */
    public static void checkQueryMenuSql(Map<String, String> extend, XyCallBack xyCallBack) {

        MenuInfo menuInfo = MenuInfoManager.queryMenuInfo("menuMain");
        if (menuInfo == null) {
            MenuInfoManager.insertOrUpdateMenuInfo("menuMain");// 新增一条记录
        }

        MenuInfoManager.findMenuList(extend, xyCallBack);// 检测更新
    }

    public static String queryMenuByPhoneNum(Context ctx, String phoneNum, int numType, String simIccid, Map<String, String> extend, final SdkCallBack callBack) {
        if (StringUtils.isPhoneNumber(phoneNum)) {
            if (callBack != null) {
                callBack.execute("");
            }
            return "";
        }
        String cnum = StringUtils.getValueByKey(extend, "cnum");
        String areaCode = StringUtils.getValueByKey(extend, "code");
        int simIndex = PubInfoManager.parseSimIndex(StringUtils.getValueByKey(extend, "simIndex"));      
//        LogManager.i("queryMenuByPhoneNum", "prev cnum:" + cnum + " simIccid: " + simIccid + " areaCode=" + areaCode + " simIndex=" + simIndex);
        if (StringUtils.isNull(areaCode)) {// 如果map中没有areaCode,则通过iccid、短信中心号码、simIndex查询归属地。
            /* SDK-485 huangzhiqiang 20160622 start */
            areaCode = IccidLocationUtil.getAreaCodeByCnumOrIccid(cnum, simIndex, simIccid, phoneNum);
            /* SDK-485 huangzhiqiang 20160622 end */
        }

//        LogManager.i("queryMenuByPhoneNum", "next cnum:" + cnum + " simIccid: " + simIccid + " areaCode: " + areaCode + " numType=" + numType + " phoneNum=" + phoneNum + " simIndex=" + simIndex);

        boolean excludeCn = false;
        if (extend != null) {
            // 排除使用全国数据。
            excludeCn = extend.containsKey("EXCLUDE_CN");
        }
        /*SDK-485 songzhirong 20160615 start*/
        JSONArray jsonArr = PubInfoManager.queryMenuByNum(phoneNum, areaCode, numType, excludeCn, simIccid, cnum, simIndex, callBack);
        /*SDK-485 songzhirong 20160615 end*/

        if (jsonArr != null && jsonArr.length() > 0) {
            // String res= JsonUtil.PubMenuInfoListToJson(pubMenuInfolist);
            String res = "";
            if (jsonArr.length() >= 3) {
                res = jsonArr.toString();
            }
            if (callBack != null) {
                callBack.execute(res);
            }
            final String _areaCode = areaCode;
            final String _simIccid = simIccid;
            NetUtil.executeRunnable(new Runnable() {

                @Override
                public void run() {
                    try {
                        /*SDK-613 hewengao/20160908 start*/
                        if (NetUtil.checkAccessNetWork(2)) {
                           checkPubInfoUpdate(_areaCode, _simIccid);
                        }
                        /*SDK-613 hewengao/20160908 start*/
                    } catch (Throwable e) {
                        LogManager.e(Constant.TAG, e.getMessage(), e);
                    }
                    
                }
            });

            return res;
        }else if(callBack !=null){
        /* SDK-755 kangwenbo 20170504 start*/
            callBack.execute("");
        /* SDK-755 kangwenbo 20170504 end*/
        }
        return "";
    }

    public static String parseSmsToClassify(Context ctx, Map<String, Object> res) {

        if (res != null) {
            String titleNum = (String) res.get("title_num");
            if (!StringUtils.isNull(titleNum)) {
                try {
                    JSONObject js = new JSONObject();
                    js.put("scenetype", titleNum);
                    return js.toString();
                } catch (Throwable e) {
//                    e.printStackTrace();
                    LogManager.e(Constant.TAG, "parseSmsToClassify: ", e);

                }
            }
        }
        return "";
    }

    /**
     * 后台线程检测，批量检测更新企业资料数据。在WIFI 环境下执行。
     * 
     * @param code
     * @param iccid
     */
    private static void checkUpdatePubInfoBackGround(final String code, final String iccid) {
        /*ONEPLUS-1607 songzhirong 20161022 start*/
    	  Long cacheTime = Constant.checkCodeIccidMap.get(code+iccid);
          long time = 0;
          if (cacheTime != null) {
              time = cacheTime;
          }
          long addTaskForTime = Constant.addTaskForTime;
          if (System.currentTimeMillis() >= (time + addTaskForTime)){  
        	  // 是否支持在线查询（0不支持，1支持（默认））
              if(mPubBackRunnable2.isRun){
                  return;
              }
              int type = SysParamEntityManager.getIntParam(Constant.getContext(), Constant.QUERY_ONLINE);
              if (type == 0) {
                  return;
              }
              mPubBackRunnable2.areaCode=code;
              mPubBackRunnable2.iccid=iccid;
              /*SDK-616 hewengao 20160912 start*/
              SmartSmsThreadPoolManager.mUploadPubInfoPool.execute(mPubBackRunnable2);
              /*SDK-616 hewengao 20160912 end*/
              Constant.checkCodeIccidMap.put(code+iccid, System.currentTimeMillis());
          }         
          /*ONEPLUS-1607 songzhirong 20161022 end*/
    }

    /*IMOO-21 likuangkuang 20170104 start, add newThread param to provide sync call */
    private static void querySinglePubInfoFromNetServer(final String phoneNum, final String cnum, final int numType, final String code, final String iccid, final XyCallBack callBack, final boolean supportAllNet,
            final boolean needUpdateNow, boolean newThread) {
        /* SDK-397 huangzhiqiang 20160524 end */
        int type = SysParamEntityManager.getIntParam(Constant.getContext(), Constant.QUERY_ONLINE);
        if (type == 0) {
            return;
        }

        Runnable r = new Runnable() {
        /*SDK-616 hewengao 20160912 end*/
            @Override
            public void run() {
                try {
                    /*SDK-633 hewengao 20161009 start*/
                    SmartSmsThreadPoolManager.setThreadNameAndPriority(SmartSmsThreadPoolManager.TNAME_QUERY_PUBINFO, Process.THREAD_PRIORITY_BACKGROUND);
                    /*SDK-633 hewengao 20161009 end*/
                    if ((NetUtil.isEnhance() && supportAllNet) || NetUtil.checkAccessNetWork(1)) {
                        /* SDK-397 huangzhiqiang 20160524 start */
                        // 如果是增强开关开启，且在单个时，如果可以支持任意网络。或者 当前网络策略是WIFI
                        PubInfoNetService.queryPubInfoRequest(false, phoneNum, cnum, code, iccid, String.valueOf(numType), callBack, 0, false, false, needUpdateNow);
                        /* SDK-397 huangzhiqiang 20160524 end */
                    }
                } catch (Throwable e) {
                    LogManager.e(Constant.TAG, "querySinglePubInfoFromNetServer: ", e);

                }
            }
        };
        
        /*SDK-616 hewengao 20160912 start*/
        
        if (newThread) {
            SmartSmsThreadPoolManager.pubInfoPool.execute(r);
        } else {
            r.run();
        }        
    }
    /*IMOO-21 likuangkuang 20170104 end*/
    
    /**
     * 查询单个号码对应的企业资料从网络服务器
     * 
     * @param phoneNum
     * @param cnum
     * @param numType
     * @param code
     * @param iccid
     * @param callBack
     */
    /* SDK-397 huangzhiqiang 20160524 start */
    private static void querySinglePubInfoFromNetServer(final String phoneNum, final String cnum, final int numType, final String code, final String iccid, final XyCallBack callBack, final boolean supportAllNet,
            final boolean needUpdateNow) {
        querySinglePubInfoFromNetServer(phoneNum, cnum, numType, code, iccid, callBack, needUpdateNow, supportAllNet, true);
    }
}
